/**
 * 问有多少个点对距离为1
 * 规模只有100，直接暴力
 */
#include <bits/stdc++.h>
using namespace std;

struct Point{
    int x, y;
    Point(int a=0,int b=0):x(a),y(b){}
    void input(){
        cin >> x >> y;
    }
};

int cross(const Point & O, const Point & A, const Point & B){
    auto xoa = A.x - O.x;
    auto xob = B.x - O.x;
    auto yoa = A.y - O.y;
    auto yob = B.y - O.y;
    return xoa * yob - xob * yoa;
}

int dot(const Point & O, const Point & A, const Point & B){
    auto xoa = A.x - O.x;
    auto xob = B.x - O.x;
    auto yoa = A.y - O.y;
    auto yob = B.y - O.y;
    return xoa * xob + yoa * yob;
}

int dist2(const Point & A, const Point & B){
    auto x = A.x - B.x;
    auto y = A.y - B.y;
    return x * x + y * y;
}

int N;
vector<Point> Vec;

void work(){
    cin >> N;
    Vec.assign(N, {});
    for(auto & p : Vec) p.input();

    int ans = 0;
    for(int i=0;i<N;++i)for(int j=i+1;j<N;++j){
        if(1 == dist2(Vec[i], Vec[j])){
            ans += 1;
        }
    }
    cout << ans << endl;
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    int nofkase = 1;
    while(nofkase--) work();
	return 0;
}